// src/api/user.js
import request from '@/utils/request'

// 登录
export function login(data) {
  return request({
    url: 'api/public/auth/login',
    method: 'post',
    data
  })
}
// 注册
export function register(data) {
  return request({
    url: 'api/public/auth/register',
    method: 'post',
    data
  })
}
// 短信验证码
export function sendSmsCode(data) {
  return request({
    url: 'api/public/auth/sendSmsCode',
    method: 'post',
    data
  })
}
// 短信登录
export function smsLogin(data) {
  return request({
    url: 'api/public/auth/smsLogin',
    method: 'post',
    data
  })
}

//忘记密码
export function forgetPassword(data) {
  return request({
    url: 'api/private/auth/forgetPassword',
    method: 'post',
    data
  })
}
// 获取验证码
export function getcode(params) {
  return request({
    url: '/code',
    method: 'get',
    data:params
  })
}


//获取数据字典
export function getDictionaryList(params) {
  return request({
    url: 'api/public/dict/v1/dictionaryList',
    method: 'get',
    params
  })
}
export function getGXDivision(params) {
  return request({
    url: 'api/public/dict/v1/gx/division',
    method: 'get',
    params
  })
}
// 获取用户信息
export function getUserInfo() {
  return request({
    url: 'api/private/auth/userinfo',
    method: 'get'
  })
}

// 登出
export function logout() {
  return request({
    url: 'api/private/auth/logout',
    method: 'delete'
  })
}
export function authCompany(data) {
  return request({
    url: 'api/private/company/v1/authCompany ',
    method: 'post',
    data
  })
}

export function changePassword(data) {
  return request({
    url: 'api/private/auth/changePassword',
    method: 'post',
    data
  })
}

export function sendChangePasswordSmsCode(data) {
  return request({
    url: 'api/private/auth/sendChangePasswordSmsCode ',
    method: 'post',
    data
  })
}